import 'package:flutter/material.dart';

class UIUtils {
  static BoxDecoration boxDecoration = const BoxDecoration(
      color: Colors.white,
      borderRadius: BorderRadius.all(Radius.circular(8)),
      boxShadow: [
        BoxShadow(
            color: Colors.black12,
            offset: Offset(1, 2), // 阴影xy轴偏移量
            blurRadius: 8, // 阴影模糊程度
            spreadRadius: 0 // 阴影扩散程度
            )
      ]);

  static Border border =
      const Border(top: BorderSide(width: 1, color: Color(0xFFDDDDDD)));

  static BorderRadius borderRadius = const BorderRadius.all(Radius.circular(8));

  static BoxDecoration borderWaybillCardImg = const BoxDecoration(
    image: DecorationImage(
      fit: BoxFit.fill,
      image: AssetImage('images/settlement/card_bg.png'),
    ),
  );

  static AppBar getAppBar(BuildContext context, {required Map params}) {
    return AppBar(
      title: Text(
        params['name'],
        style: const TextStyle(fontSize: 16, color: Color(0xFF1D2023)),
      ),
      centerTitle: true,
      elevation: 0,
      backgroundColor: Colors.white,
      leading: IconButton(
        icon: const Icon(
          Icons.arrow_back_ios,
          size: 20,
          color: Color(0xFF1D2023),
        ),
        onPressed: () {
          Navigator.pop(context);
        },
      ),
    );
  }
}
